package cn.hr.entity;


import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 学生实体类
 */
@Entity
@Table(name="tb_student"
    ,catalog="hrm"
)

public class Student  implements java.io.Serializable {


    /**
	 * 
	 */
	private static final long serialVersionUID = 2580808020281405437L;
	// Fields    

     private Long id;
     private ClassInfo classInfo;
     private User user;
     private String userName;
     private Boolean sex;
     private String photo;
     private String nativePlace;
     private String nation;
     private String cardId;
     private String studentNo;
     private String email;
     private String qq;
     private String telephone;
     private String shortTel;
     private String hobby;
     private String introduction;
     private Integer points;
     private String referrer;
     private Date regTime;
     private Timestamp lastLoginTime;
     private Timestamp lastUpdateTime;
     private String state;
     private Set<PersonalRecord> personalRecords = new HashSet<PersonalRecord>(0);
     private Set<ItemRecord> itemRecords = new HashSet<ItemRecord>(0);


    // Constructors

    /** default constructor */
    public Student() {
    }

	/** minimal constructor */
    public Student(ClassInfo classInfo, User user, String userName, Boolean sex, String nativePlace, String nation, String cardId, String studentNo, String email, String qq, String telephone, String introduction, Integer points, Date regTime, Timestamp lastLoginTime, Timestamp lastUpdateTime, String state) {
        this.classInfo = classInfo;
        this.user = user;
        this.userName = userName;
        this.sex = sex;
        this.nativePlace = nativePlace;
        this.nation = nation;
        this.cardId = cardId;
        this.studentNo = studentNo;
        this.email = email;
        this.qq = qq;
        this.telephone = telephone;
        this.introduction = introduction;
        this.points = points;
        this.regTime = regTime;
        this.lastLoginTime = lastLoginTime;
        this.lastUpdateTime = lastUpdateTime;
        this.state = state;
    }
    
    /** full constructor */
    public Student(ClassInfo classInfo, User user, String userName, Boolean sex, String photo, String nativePlace, String nation, String cardId, String studentNo, String email, String qq, String telephone, String shortTel, String hobby, String introduction, Integer points, String referrer, Date regTime, Timestamp lastLoginTime, Timestamp lastUpdateTime, String state, Set<PersonalRecord> personalRecords, Set<ItemRecord> itemRecords) {
        this.classInfo = classInfo;
        this.user = user;
        this.userName = userName;
        this.sex = sex;
        this.photo = photo;
        this.nativePlace = nativePlace;
        this.nation = nation;
        this.cardId = cardId;
        this.studentNo = studentNo;
        this.email = email;
        this.qq = qq;
        this.telephone = telephone;
        this.shortTel = shortTel;
        this.hobby = hobby;
        this.introduction = introduction;
        this.points = points;
        this.referrer = referrer;
        this.regTime = regTime;
        this.lastLoginTime = lastLoginTime;
        this.lastUpdateTime = lastUpdateTime;
        this.state = state;
        this.personalRecords = personalRecords;
        this.itemRecords = itemRecords;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="classInfoId", nullable=false)

    public ClassInfo getClassInfo() {
        return this.classInfo;
    }
    
    public void setClassInfo(ClassInfo classInfo) {
        this.classInfo = classInfo;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="userId", nullable=false)

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    
    @Column(name="userName", nullable=false, length=16)

    public String getUserName() {
        return this.userName;
    }
    
    public void setUserName(String userName) {
        this.userName = userName;
    }
    
    @Column(name="sex", nullable=false)

    public Boolean getSex() {
        return this.sex;
    }
    
    public void setSex(Boolean sex) {
        this.sex = sex;
    }
    
    @Column(name="photo")

    public String getPhoto() {
        return this.photo;
    }
    
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    
    @Column(name="nativePlace", nullable=false, length=16)

    public String getNativePlace() {
        return this.nativePlace;
    }
    
    public void setNativePlace(String nativePlace) {
        this.nativePlace = nativePlace;
    }
    
    @Column(name="nation", nullable=false, length=16)

    public String getNation() {
        return this.nation;
    }
    
    public void setNation(String nation) {
        this.nation = nation;
    }
    
    @Column(name="cardId", nullable=false, length=20)

    public String getCardId() {
        return this.cardId;
    }
    
    public void setCardId(String cardId) {
        this.cardId = cardId;
    }
    
    @Column(name="studentNo", nullable=false, length=16)

    public String getStudentNo() {
        return this.studentNo;
    }
    
    public void setStudentNo(String studentNo) {
        this.studentNo = studentNo;
    }
    
    @Column(name="email", nullable=false, length=32)

    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="qq", nullable=false, length=16)

    public String getQq() {
        return this.qq;
    }
    
    public void setQq(String qq) {
        this.qq = qq;
    }
    
    @Column(name="telephone", nullable=false, length=16)

    public String getTelephone() {
        return this.telephone;
    }
    
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    
    @Column(name="shortTel", length=16)

    public String getShortTel() {
        return this.shortTel;
    }
    
    public void setShortTel(String shortTel) {
        this.shortTel = shortTel;
    }
    
    @Column(name="hobby")

    public String getHobby() {
        return this.hobby;
    }
    
    public void setHobby(String hobby) {
        this.hobby = hobby;
    }
    
    @Column(name="introduction", nullable=false, length=600)

    public String getIntroduction() {
        return this.introduction;
    }
    
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }
    
    @Column(name="points", nullable=false)

    public Integer getPoints() {
        return this.points;
    }
    
    public void setPoints(Integer points) {
        this.points = points;
    }
    
    @Column(name="referrer", length=16)

    public String getReferrer() {
        return this.referrer;
    }
    
    public void setReferrer(String referrer) {
        this.referrer = referrer;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="regTime", nullable=false, length=0)

    public Date getRegTime() {
        return this.regTime;
    }
    
    public void setRegTime(Date regTime) {
        this.regTime = regTime;
    }
    
    @Column(name="lastLoginTime", nullable=false, length=0)

    public Timestamp getLastLoginTime() {
        return this.lastLoginTime;
    }
    
    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
    
    @Column(name="lastUpdateTime", nullable=false, length=0)

    public Timestamp getLastUpdateTime() {
        return this.lastUpdateTime;
    }
    
    public void setLastUpdateTime(Timestamp lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }
    
    @Column(name="state", nullable=false, length=16)

    public String getState() {
        return this.state;
    }
    
    public void setState(String state) {
        this.state = state;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="student")

    public Set<PersonalRecord> getPersonalRecords() {
        return this.personalRecords;
    }
    
    public void setPersonalRecords(Set<PersonalRecord> personalRecords) {
        this.personalRecords = personalRecords;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="student")

    public Set<ItemRecord> getItemRecords() {
        return this.itemRecords;
    }
    
    public void setItemRecords(Set<ItemRecord> itemRecords) {
        this.itemRecords = itemRecords;
    }
   








}